<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css" />
    <style>
        body {
            margin: 0;
            background-color: #f5f5f5;
        }

        #header_top {
            background: #fff;
        }

        #header_top .aui-icon-left,
        #header_top .aui-title,
        #header_top .aui-icon-search,
        #header_top .aui-pull-right .aui-iconfont {
            color: #333;
        }

        .con_top {
            font-size: 0.6rem;
            color: #999;
            padding: 0.25rem 0.75rem;
        }
        .aui-list,.aui-list .aui-list-item {
          background-size: 0px;
        }
        #app ul li {
          border-top: 0.5rem solid #f5f5f5;
        }
    </style>
</head>

<body>
    <header class="aui-bar aui-bar-nav" id="header_top">
        <a class="aui-pull-left aui-btn" onclick="goback()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">绑定银行卡</div>

    </header>
    <div id="app" v-cloak>
        <ul class="aui-list aui-form-list">
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        卡类型
                    </div>
                    <div class="aui-list-item-input">
                        {{caseardType}}
                    </div>
                </div>
            </li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        手机号
                    </div>
                    <div class="aui-list-item-input">
                        <input type="text" placeholder="请填写银行预留手机号" v-model="phone">
                    </div>
                </div>
            </li>
        </ul>
        <button type="button" name="button" class="user_set_btn" @click="isCard()" style="border-radius: 1rem;">下一步</button>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript" src="../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../script/aui-slide.js"></script>
<script type="text/javascript">
    function goback() {
        api.closeWin()
    }
    apiready = function() {
        var app = new Vue({
            el: '#app',
            data: {
                caseardType: '',
                phone: '',
                name: api.pageParam.name || '',
                bank_num: api.pageParam.bank_num || '',
                data: []
            },
            created: function() {
                var $_this = this;
                $_this.data = api.pageParam.data || '';
                $_this.caseardType = $_this.data.bank_name + $_this.data.bank_type
            },
            methods: {
                isCard:function() {
                  var $_this = this;
                  if($_this.phone  == '' || !/^[1][3,4,5,7,8][0-9]{9}$/.test($_this.phone )) {
                    api.toast({
                        msg: '银行预留手机号格式错误',
                        duration: 1000,
                        location: 'bottom'
                    });
                    return;
                  }
                  api.openWin({
                      name: 'yz_Card',
                      url: './yz_Card.html',
                      pageParam: {
                        name:$_this.name,
                        bank_num:$_this.bank_num,
                        phone:$_this.phone
                      }
                  });
                }
            }
        })

    }
</script>

</html>
